package com.atguigu.spzx.user.controller;

import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.user.service.SmsService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Tag(name = "短信模块")
@RequestMapping("/api/user/sms")
public class SmsController {
    @Resource
    SmsService smsService;
    // 发送短信业务： sendCode/{mobile}/{type}  type: 1注册  2登录 3充值 4提现.....
    @Operation(summary = "发送短信")
    @GetMapping("/sendCode/{mobile}")
    public Result sendCode(@PathVariable("mobile")String mobile){
        smsService.sendCode(mobile);
        return Result.ok(null);
    }
}
